<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var info = {
      name: "why",
      age: 18,
      height: 1.88
    }
    var infoKeys = Object.keys(info)
    for (var i = 0; i < infoKeys.length; i++) {
      var key = infoKeys[i]
      var value = info[key]
      console.log(`key:${key},value:${value}`)
    }

    for (var key in info) {
      var value = info[key]
      console.log(`key:${key},value:${value}`)
    }
    // for (var foo of info) {
    //   console.log(foo)
    // }
  </script>
</body>

</html>